const { queryError } = require("../../constant/err.type");

const { querySuccess } = require("../../constant/success.type");

const { getRegion } = require("../../service/common/region.service");

class RegionController {
  async getRegion(ctx, nuxt) {
    try {
      const db_response = await getRegion(ctx.request.query);
      querySuccess.result = db_response;
      ctx.body = querySuccess;
    } catch (err) {
      console.log(err);
      ctx.app.emit("error", queryError, ctx);
    }
  }
}
module.exports = new RegionController();
